﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;
using Carbon.Web.Forms.Controls;

namespace Carbon.Web.Forms
{
    public class CollectionEditorCommandEventArgs : CommandEventArgs
    {
        private Object m_OriginalSource = default(Object);
        public Object OriginalSource
        {
            get
            {
                return m_OriginalSource;
            }
        }

        private CollectionEditorItem m_Item = default(CollectionEditorItem);
        public CollectionEditorItem Item
        {
            get
            {
                return m_Item;
            }
        }

        public Object Data
        {
            get
            {
                return Item.DataItem;
            }
        }

        public CollectionEditorCommandEventArgs(string commandName, object argument, object originalSource, CollectionEditorItem item)
            : base(commandName, argument)
        {
            if (originalSource == null) throw new ArgumentNullException("originalSource");
            if (item == null) throw new ArgumentNullException("item");

            this.m_OriginalSource = originalSource;
            this.m_Item = item;
        }
        public CollectionEditorCommandEventArgs(CommandEventArgs e, object originalSource, CollectionEditorItem item)
            : base(e)
        {
            if (originalSource == null) throw new ArgumentNullException("originalSource");
            if (item == null) throw new ArgumentNullException("item");

            this.m_OriginalSource = originalSource;
            this.m_Item = item;
        }


    }
}
